package com.ts.utils;

import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.lang.StringUtils;


public class StringUtil {
	public static boolean isBlank(String str){
		boolean flag = false;
		if(str == null || "".equals(str)){
			flag = true;
		}
		return flag;
	}
	
	public static String getUUID() {
		return UUID.randomUUID().toString().replaceAll("-", "");
	}
	
	public static String replaceBlank(String string){
		
		String result = "";
		
		if(!StringUtils.isEmpty(string)){
			Pattern p = Pattern.compile("\\s*|\t|\r|\n");
			Matcher m = p.matcher(string);
			result = m.replaceAll("");
			result.trim();
		}
		
		return result;
	}
}
